{{#if collectionNotEmpty}}
<table id="pools-table" class="table table-bordered table-striped share-table data-table" width="100%" summary="List of pools">
  <thead>
    <tr>
      <th>Name</th>
      <th>Size</th>
      <th>Usage</th>
      <th>Raid</th>
      <th>Compression</th>
      <th>Extra mount options</th>
      <th>Disks</th>
      <th>Actions</th>
      </tr>
  </thead>
  <tbody>
    {{#each poolCollection}}
        <tr>
            <td><a href="#pools/{{this.id}}"><i class="glyphicon glyphicon-list"></i>&nbsp;{{this.name}}</a>
            {{#if (isRoot this.role)}}
                <i class="fa fa-exclamation-circle" title="This Pool is created during install and contains the OS.
                You can create Shares in it like in any other pool on the system.
                However, operations like resize, compression and deletion are not allowed." rel="tooltip"></i>
            {{/if}}</td>

            <td>{{humanReadableSize 'size' this.size this.reclaimable this.free}}
                {{#unless (isRoot this.role)}}
                      &nbsp;<a href="#pools/{{this.id}}/?cView=resize"><i class="fa fa-pencil-square-o"></i></a>
                {{/unless}}
            </td>

            <td>{{humanReadableSize 'usage' this.size this.reclaimable this.free}}
                <strong>({{humanReadableSize 'usagePercent' this.size this.reclaimable this.free}} %)</strong>
            </td>

            <td>{{this.raid}}
                {{#unless (isRoot this.role)}}
                      &nbsp;<a href="#pools/{{this.id}}/?cView=resize"><i class="fa fa-pencil-square-o"></i></a>
                {{/unless}}
            </td>
            <td>
            {{#if (isRoot this.role)}}
                    OFF
            {{else}}
                <strong><a href="#" class="status" data-type="select" data-mntoptn="{{this.mnt_options}}" data-pid="{{this.id}}">
                {{this.compression}}</a></strong>
            {{/if}}
            </td>
            <td>{{#unless (isRoot this.role)}}
                <strong><a href="#" class="mntOptns" data-type="text" data-comp="{{this.compression}}" data-pid="{{this.id}}">
                {{this.mnt_options}}</a></strong>
                {{/unless}}
            </td>
            <td>
                {{#if (isRoot this.role)}}
                    {{#each this.disks}}
                    "{{this.name}}
                    {{#if (isOpenLuks this.role)}}
                        <a href="#disks/luks/{{this.id}}" class="open_luks_drive"
                           data-disk-id="{{this.id}}"
                           title="Open LUKS Volume, click to review." rel="tooltip">
                        <i class="glyphicon glyphicon-eye-open"></i></a>
                    {{/if}}
                    "&nbsp;
                    {{/each}}
                {{else}}
                    {{#each this.disks}}
                    "{{this.name}}
                    {{#if this.parted}}
                        <a href="#disks/role/{{this.id}}" class="user_role_part"
                            data-disk-id="{{this.id}}"
                            title="Partition (Redirect Role), click to review."
                            rel="tooltip"><i class="glyphicon glyphicon-tags"></i></a>
                    {{/if}}
                    {{#if (isOpenLuks this.role)}}
                        <a href="#disks/luks/{{this.id}}" class="open_luks_drive"
                           data-disk-id="{{this.id}}"
                           title="Open LUKS Volume, click to review." rel="tooltip">
                        <i class="glyphicon glyphicon-eye-open"></i></a>
                    {{/if}}
                    "&nbsp;
                    {{/each}}
                {{/if}}
            </td>
            <td>{{#if (isRoot this.role)}}
                    N/A
                {{else}}
                    <a id="delete_pool_{{this.id}}" data-id="{{this.id}}" data-action="delete" rel="tooltip" title="Delete pool">
                    <i class="glyphicon glyphicon-trash"></i></a>
                {{/if}}
            </td>
        </tr>
        <div id="delete-pool-modal-{{this.id}}" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
         <div class="modal-dialog">
          <div class="modal-content">
           <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h3 id="myModalLabel">Delete Pool ({{this.name}})</h3>
           </div>
           <div class="modal-body">
            <div class="messages"></div>
            <h4>{{this.name}} will be deleted including it's Shares listed below and their Snapshots, NFS exports, Samba and SFTP config and Replics. Are you sure?</h4>
            <ul id="pool-shares"></ul>
           </div>
           <div class="modal-footer">
            <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Cancel</button>
            <button id="js-confirm-pool-delete" data-id="{{this.id}}" class="btn btn-primary">Confirm</button>
           </div>
          </div>
         </div>
        </div>
    {{/each}}
  </tbody>
</table>
{{ else }}
<h4>No Pools have been created</h4>
{{/if}}
<div>
    <a {{#if disksAvailable}}
            href="#add_pool"
        {{else}}
            disabled title="There are no Disks available to create a Pool at this time.
        {{/if}}
    id="add_pool" class="btn btn-primary"><i class="glyphicon glyphicon-edit"></i>&nbsp;Create Pool</a>
</div>
